from rest_framework.decorators import api_view
from rest_framework.response import Response

from api.serializers.banner_serializer import BannerSerializer
from app.models.banner import Banner


@api_view(['GET'])
def get_banners(request):
    query_set = Banner.objects.all()
    serializer = BannerSerializer(query_set, many=True)
    return Response(serializer.data)
